package cn.tedu.inner;

//测试 匿名内部类
public class Test2_Inner {
    public static void main(String[] args) {
        new Inter() {

            @Override
            public void save() {
                System.out.println("数据保存成功！");
            }

            @Override
            public void delete(int id) {
                System.out.println("数据删除成功！，id是：" + id);
            }
        }.delete(6);
//        inter.save();
//        inter.delete(6);
    }
}
interface Inter{
    void save();
    void delete(int id);
}
class InterImpl implements Inter{

    @Override
    public void save() {
        System.out.println("数据保存成功！");
    }

    @Override
    public void delete(int id) {
        System.out.println("数据删除成功！，id是："+id);
    }
}